<template>
	<div class="bread-crumb">
		<a-breadcrumb>
			<a-breadcrumb-item href="/">
				<a-icon type="home" />
			</a-breadcrumb-item>
			<a-breadcrumb-item :href="item.path" v-for="item in levelList" :key="item.path" v-show="item.meta.title">
				<a-icon :type="item.meta.icon" v-if="item.meta.icon"/>
				<router-link :to="{ name: item.name }">{{item.meta.title}}</router-link>
			</a-breadcrumb-item>
		</a-breadcrumb>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				levelList: null
			};
		},
		created() {
			this.getBreadcrumb();
		},
		methods: {
			getBreadcrumb() {
				this.levelList = this.$route.matched;
			}
		},
	}
</script>
<style lang="less" scoped>
	.bread-crumb {
		margin-right: 15px;
	}
</style>
